package org.example.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.type.JdbcType;
import org.example.pojo.ItripHotelRoom;
import org.example.vo.recommend.image.Recommend_Image;
import org.example.vo.recommend.paidlisting.Recommend_PaidListing;
import org.example.vo.recommend.room.Recommend_HotelRoom;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface ItripHotelRoomMapper extends BaseMapper<ItripHotelRoom> {
    @Select("select ih.id,im.imgUrl from itrip_image im inner join itrip_hotel ih on im.targetId = ih.id\n" +
            "where im.type = '0' and position = 1 and ih.redundantCityName = #{city}")
    @Results({
            @Result(column="id", property="id", jdbcType= JdbcType.BIGINT, id=true),
            @Result(column="imgUrl", property="imgUrl", jdbcType= JdbcType.VARCHAR)
    })
    List<Recommend_Image> queryByImgUrl(String city);
}
